package com.nf.db.handler.list;

import com.nf.db.ResultSetHandler;

import javax.xml.crypto.dsig.keyinfo.RetrievalMethod;
import java.lang.reflect.Field;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import static com.nf.db.RowProcessor.DEFAULT_ROWPROCESSOR;

public class BeanListHandler<T> extends AbstractListHandler<T> {
    private Class<?> beanClz;

    public BeanListHandler(Class<?> beanClz) {
        this.beanClz = beanClz;
    }

    @Override
    protected T handleRow(ResultSet rs) throws SQLException {
        return DEFAULT_ROWPROCESSOR.toBean(rs, this.beanClz);
    }

}
